package com.szholly.plug.activity.runtime;

import com.szholly.data.general.ITable;
import com.szholly.data.general.RowBase;
import com.szholly.plug.safe.entity.user.UserEntity;

/**
 * 定义工作流处理接口
 */
public interface IWorkFlowCompont {
	
	/**
	 * 启动流程
	 * 默认规则为：流程启动
	 * @param rowBase
	 * @param userEntity 当前用户
	 */
	void onlyStart(ITable pTable, RowBase rowBase, UserEntity userEntity, String activitiKey);
	
	/**
	 * 启动流程
	 * 默认规则为：流程启动后直接跳过第一个用户任务节点
	 * @param rowBase
	 * @param userEntity 当前用户
	 */
	void start(ITable pTable, RowBase rowBase, UserEntity userEntity, String activitiKey);
	
	/**
	 * 流程撤销
	 * @param exeId
	 * @param rowBase
	 * @param userEntity
	 */
	void revoke(ITable pTable, String pDefId, String exeId, RowBase rowBase, UserEntity userEntity);
	
	/**
	 * 流程撤回
	 * @param exeId
	 * @param rowBase
	 * @param userEntity
	 */
	void reback(ITable pTable, String pDefId, String exeId, RowBase rowBase, UserEntity userEntity);
	
	/**
	 * 交办
	 * @param pDefId
	 * @param exeId
	 * @param rowBase
	 * @param userEntity
	 */
	void assignedBy(ITable pTable, String pDefId, String exeId, RowBase rowBase, UserEntity userEntity);

	/**
	 * 完成任务
	 */
	void complete(ITable pTable, String activitiKey, String exeId, RowBase rowBase, UserEntity userEntity);
	
	/**
	 * 根据流程实例，获取流程定义key
	 * @param exeId
	 * @return
	 */
	String getProcessDefinitionKey(String exeId);
}